﻿Option Strict On
Option Explicit On
Option Infer On

#Region "Imports"
Imports System
Imports System.Linq
Imports System.Collections.Generic
Imports GenDotNet.ObjectModel
Imports GenDotNet.TemplateSupport
Imports GenDotNet.TemplateSupport.Strings
Imports GenDotNet.TemplateSupport.VB
Imports GenDotNet.Task.Common
Imports <xmlns:orm="http://kadgen.com/KADORM.xsd">
#End Region

Public Class EditableRootUser
	Inherits DotNetLanguageBase

#Region "Required methods with static contents"
   ' NEWTEMPLATE: Change to new guid for every new template
	Private ReadOnly _templateGuid As New Guid("{ACCA7F40-6DF5-4967-9B73-6D94E3F3F225}")
	Public Overrides ReadOnly Property Id() As System.Guid
		Get
			Return _templateGuid
		End Get
	End Property

	Protected Overrides Function GetFileImports() As TemplateSupport.ImportInfoCollection
		Return New CslaTemplate.Support.CslaImportInfoCollection
	End Function

   Protected Overrides Function GetFileName() As String
      Return OutputFileName(ObjectData.ClassName)
   End Function

#End Region

   Protected Overrides Function GenerateContents() As String
      Dim classInfo = New TypeInfo(ObjectData.ClassName, Scope.Public, TypeCategory.Class, TypeModifiers.None)
      classInfo.InheritsFrom = New TypeInfo(ObjectData.ClassName.BaseName, Scope.Public, TypeCategory.Class, TypeModifiers.None)
      classInfo.Attributes.AddSerializable()

      Return _
        <code>
      '''&lt;summary>
      '''This partial class is intended solely for handcrafted code.
      '''The code you add here will either support CSLA (such as
      '''additional validation) or provide new features (such as
      '''a full name).
      '''&lt;/summary>
      '''&lt;remarks>
      '''Do NOT add constructors to this class. All business
      '''classes are created through factories in CSLA.
      '''&lt;/remarks>
   <%= OutputClass(classInfo, AddressOf ClassRootObject) %>
        </code>.Value
   End Function

   Protected Function ClassRootObject() As String
      Return String.Empty
   End Function
End Class
